2020-2021 Sunseeker Telemetry and Lighting System
flashctl_ex2_eraseCopyWrite.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define INFOC_START   (0x1880)
 
#define INFOD_START   (0x1800)
 
#define NUMBER_OF_BYTES   128
 
#define DELAY_TIME   1000000
 

Functions

void write_SegC (void)
 
void copy_C2D (void)
 
void main (void)
 

Variables

uint8_t calibration_data [NUMBER_OF_BYTES]
 

Macro Definition Documentation

◆ DELAY_TIME

#define DELAY_TIME   1000000

Definition at line 89 of file flashctl_ex2_eraseCopyWrite.c.

◆ INFOC_START

#define INFOC_START   (0x1880)

This program first erases flash seg C, then it increments all values in seg C, then it erases seg D, then copies seg C to seg D. LED toggles upon completion. Starting addresses of segments defined in this code: Seg C-0x1880, Seg D-0x1800. ACLK = REFO = 32kHz, MCLK = SMCLK = default DCO 1048576Hz

Tested On: MSP430F5529

/|| | | | P1.0|-LED –|RST | | |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • Flash module
  • GPIO Port peripheral

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • None.

Definition at line 62 of file flashctl_ex2_eraseCopyWrite.c.

◆ INFOD_START

#define INFOD_START   (0x1800)

Definition at line 68 of file flashctl_ex2_eraseCopyWrite.c.

◆ NUMBER_OF_BYTES

#define NUMBER_OF_BYTES   128

Definition at line 75 of file flashctl_ex2_eraseCopyWrite.c.

Function Documentation

◆ copy_C2D()

void copy_C2D ( void  )

Definition at line 165 of file flashctl_ex2_eraseCopyWrite.c.

References INFOC_START, INFOD_START, NUMBER_OF_BYTES, status, and STATUS_FAIL.

Referenced by main().

◆ main()

void main ( void  )

◆ write_SegC()

void write_SegC ( void  )

Definition at line 142 of file flashctl_ex2_eraseCopyWrite.c.

References calibration_data, INFOC_START, NUMBER_OF_BYTES, status, and STATUS_FAIL.

Referenced by main().

Variable Documentation

◆ calibration_data

uint8_t calibration_data[NUMBER_OF_BYTES]

Definition at line 82 of file flashctl_ex2_eraseCopyWrite.c.

Referenced by main(), and write_SegC().